import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '流程状态',
    align:"center",
    dataIndex: 'bpmStatus'
   },
   {
    title: '物料',
    align:"center",
    dataIndex: 'cinventory'
   },
   {
    title: '物料编码',
    align:"center",
    dataIndex: 'cinventorycode'
   },
   {
    title: '物料id',
    align:"center",
    dataIndex: 'cinventoryid'
   },
   {
    title: '批次号',
    align:"center",
    dataIndex: 'vbatchcode'
   },
   {
    title: '仓库',
    align:"center",
    dataIndex: 'cstordoc'
   },
   {
    title: '仓库编码',
    align:"center",
    dataIndex: 'cstordoccode'
   },
   {
    title: '仓库id',
    align:"center",
    dataIndex: 'cstordocid'
   },
   {
    title: '出入库类型',
    align:"center",
    dataIndex: 'ctrantype'
   },
   {
    title: '单价',
    align:"center",
    dataIndex: 'nprice'
   },
   {
    title: '金额',
    align:"center",
    dataIndex: 'nmny'
   },
   {
    title: '来源单据类型',
    align:"center",
    dataIndex: 'vsrctype'
   },
   {
    title: '来源单据号',
    align:"center",
    dataIndex: 'vsrccode'
   },
   {
    title: '单据主表主键',
    align:"center",
    dataIndex: 'cbillid'
   },
   {
    title: '单据子表主键',
    align:"center",
    dataIndex: 'csrcbid'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '流程状态',
    field: 'bpmStatus',
    component: 'Input',
  },
  {
    label: '物料',
    field: 'cinventory',
    component: 'Input',
  },
  {
    label: '物料编码',
    field: 'cinventorycode',
    component: 'Input',
  },
  {
    label: '物料id',
    field: 'cinventoryid',
    component: 'Input',
  },
  {
    label: '批次号',
    field: 'vbatchcode',
    component: 'Input',
  },
  {
    label: '仓库',
    field: 'cstordoc',
    component: 'Input',
  },
  {
    label: '仓库编码',
    field: 'cstordoccode',
    component: 'Input',
  },
  {
    label: '仓库id',
    field: 'cstordocid',
    component: 'Input',
  },
  {
    label: '出入库类型',
    field: 'ctrantype',
    component: 'Input',
  },
  {
    label: '单价',
    field: 'nprice',
    component: 'InputNumber',
  },
  {
    label: '金额',
    field: 'nmny',
    component: 'Input',
  },
  {
    label: '来源单据类型',
    field: 'vsrctype',
    component: 'Input',
  },
  {
    label: '来源单据号',
    field: 'vsrccode',
    component: 'Input',
  },
  {
    label: '单据主表主键',
    field: 'cbillid',
    component: 'Input',
  },
  {
    label: '单据子表主键',
    field: 'csrcbid',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  bpmStatus: {title: '流程状态',order: 0,view: 'text', type: 'string',},
  cinventory: {title: '物料',order: 1,view: 'text', type: 'string',},
  cinventorycode: {title: '物料编码',order: 2,view: 'text', type: 'string',},
  cinventoryid: {title: '物料id',order: 3,view: 'text', type: 'string',},
  vbatchcode: {title: '批次号',order: 4,view: 'text', type: 'string',},
  cstordoc: {title: '仓库',order: 5,view: 'text', type: 'string',},
  cstordoccode: {title: '仓库编码',order: 6,view: 'text', type: 'string',},
  cstordocid: {title: '仓库id',order: 7,view: 'text', type: 'string',},
  ctrantype: {title: '出入库类型',order: 8,view: 'text', type: 'string',},
  nprice: {title: '单价',order: 9,view: 'number', type: 'number',},
  nmny: {title: '金额',order: 10,view: 'text', type: 'string',},
  vsrctype: {title: '来源单据类型',order: 11,view: 'text', type: 'string',},
  vsrccode: {title: '来源单据号',order: 12,view: 'text', type: 'string',},
  cbillid: {title: '单据主表主键',order: 13,view: 'text', type: 'string',},
  csrcbid: {title: '单据子表主键',order: 14,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}